<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="layui/css/layui.css">
<title>Insert title here</title>
<script type="text/javascript" language="javascript" src="js/jquery-1.9.1.min.js"></script>
<script type="text/javascript">
$(function(){
	$("#but1").click(function(){
		var username=$("input[name='username']").val();
		$.post("<%=basePath%>checkuser.do",{"username":username},function(data){
			alert(data);
		    if(data==1){
		    	location.href="savename.do?username="+username;
		    }else{
			    if(data==0)
			    	$("#notice").text("用户已激活").css("color","green");
			    else
			    	$("#notice").text("用户不存在").css("color","red");
		    }
		},"json");
	});
});
</script>


</head>
<body class="layui-layout-body">
		<!-- <form class="layui-form" action="">
  <div class="layui-form-item">
    <label class="layui-form-label">报单购货会员用户名：</label>
    <div class="layui-input-block">
     <input type="text" id="username" name="username"/><span id="notice"></span>
    <input type="submit" name="d" id="but1"  value="下一步"> -->
<form class="layui-form">
  <div class="layui-form-item">
    
    <div class="layui-input-block">
       <p><label class="layui-form-label">报单购货会员用户名：</label>
      <input type="text" name="username" lay-verify="title" autocomplete="off" placeholder="请输入用户名" class="layui-input">
      <span id="notice"></span>
      </p>
      <p><input type="button" name="d" id="but1" value="下一步"></p>
    </div>
  </div>
   
  </form>
</body>
</html>